<%--
  Created by IntelliJ IDEA.
  User: dds135246
  Date: 2020/8/13
  Time: 10:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>结算页面</title>
</head>
<link rel="stylesheet" href="/static/css/reset.css">
<link rel="stylesheet" href="/static/layui/css/layui.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_1981897_vuivu7ezc59.css">

<script src="/static/js/jquery.min.js"></script>
<script src="/static/layui/layui.all.js"></script>

<style>
    body {
        text-align: center;
    }
</style>

<body>



<script>
    //支付状态，0表示支付失败，1表示支付成功
    let isPaySuccessful = '${requestScope.isPaySuccessful}';
    let balance = '${requestScope.balance}';
    let sessionUserid = '${user.userid}';
    console.log(isPaySuccessful);
    console.log(balance);
    console.log(sessionUserid);

    //如果支付成功，则显示用户剩余余额
    if (isPaySuccessful >= 1) {
        $('body').append('<h4>支付成功。您的账户剩余<span style="color: red;">' + balance + '</span>元</h4>');
        $('body').append('<br/>' +
            '<br/>' +
            '<br/>' +
            '<h4><a href="/user/homepage.jsp">返回首页</a></h4>');
    } else { //如果支付失败，则提示用户
        $('body').append('<h4>支付失败。账户余额不足</h4>');
        $('body').append('<br/>' +
            '<br/>' +
            '<br/>' +
            '<h4><a href="/api/good/select?aid=' + sessionUserid +
            '">返回上一页</a></h4>');
    }
</script>

</body>
</html>
